-+- MS-DOS File -+ +- Interface -+- Note: these screens must be loaded from a FORTH disk! ( strings: ", ["] ) : " ( accept text delimited by " to PAD with count ) 34 WORD PAD C/L BLANKS HERE PAD HERE C@ 1+ CMOVE ; : (") ( moves text in definition to PAD ) PAD C/L BLANKS R PAD R C@ 1+ R> OVER + >R CMOVE ; : [" ( as ", but get text in definition, then to PAD at exec ) COMPILE (") 34 WORD HERE C@ 1+ ALLOT ; IMMEDIATE --> ( error handling: ABORT" ) : (AB") PAD COUNT TYPE SP! QUIT ; : ABORT" ( f -- ;abort execution and type a message ) ( if f is TRUE ) [COMPILE] IF [COMPILE] [" COMPILE (AB") [COMPILE] THEN ; IMMEDIATE ( MS-DOS file interface: support words, FNAME ) : @FCB 2+ ; ( fd -- FCB ; advances fd to start of FCB) : @FSIZE 16 + ; ( FCB -- FCB.SIZE ; returns addr of size field) : FNAME ( addr mode -- afn ; parse word at PAD as a filename ) ( afn is true if filename is ambiguous ) ( Mode determines defaults for MS-DOS function 29H) ( Parsed file name, drive+11 bytes, is left at addr) PAD 1+ SWAP (FNAME) ( -- addr' afn ) SWAP PAD 1+ - PAD C@ = 0= HEX 4000 PAD ! ( mark PAD so the name ) DECIMAL ( can't be used accidentally ) ABORT" ? Illegal filename" ; --> ·3└Ä╪Ä└Ä╨╝ ⁿ┐ ╣@ │░╨µα╘